Here I am doing a small experiment to compare different genetic architectures between snakes and newts. I will use the cost_1on1 simulation and my snake_newt_gv msprime simulation.
Outline
-Pick 4 different mu sigma combinations where musigma^2 is constant (mu=1e-11, sigma=5) to (mu=1e-8, sigma=0.005). -I picked values where musigma was constant mu=1e-11, sigma=5(A), mu=1e-10, sigma=0.5(B), mu=1e-9, sigma=0.05(C), mu=1e-8, sigma=0.005(D). The ABCD represents the group of mu and sigma. When in the newt and snake simulation the groups will be paired to make 16 pairs. -In total that will be 16 msprime simulations and 16 slim simulations -See if there are any obvious winners -make a co-evolutionary heatmap
First run this experiment with these values
Rerunning this experiment with these values
Things with 1e-6 mutation rate go every slow and end up with large file sizes. Might want to think about a different set
I ran msprime simulations and the slim simulations on cluster in GA_lt folder. My goal is to first see if there is an obvious “winner” in the co-evolutionary arms race between these species.
First, I want to look at the mean pheotypes of newts and snakes as the generations increase. Then I want to look at the difference between the mean phenotypes for each of the 16 simulations. I need to make the data frame to compare all 16 simulations. I noticed in the mu=1e-11, sigma=5 simulations that the starting pheotypes of some of the individuals were really high and sometimes the population crashed and died out.
R-code noate: I have code to make my dataframes, it combines many simulations into one graph-able dataframe. Then, I have some functions that can be called to make some figures.
The first step in seeing if there is a winner in the coevolution interaction is to read in the data and look at the results. I make a dataframe named GA_file. It contains all of the data points from my 16 simulations. I normally look at one variable at a time from all of my simulations, but since there are so few I can look at them all at once. There are over 4,000 observations with 28 variables which contains information from both newts and snakes. I focus on the mean phenotype of both the newt and the snake, usually creating a variable that looks at the difference between the mean pheotypes.
Since there are 16 simulations, for convenience I print out the simulation letter with the paramiter I used for the snake and newt mutation rate and mutation effect size
## [1] "Simulation A: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "Simulation B: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "Simulation C: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation D: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "Simulation E: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "Simulation F: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "Simulation G: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation H: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "Simulation I: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "Simulation J: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "Simulation K: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation L: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "Simulation M: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "Simulation N: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "Simulation O: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation P: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-11, 5.0)"
The first thing I want to look at are the difference between snake and newt mean phenotypes as the number of generations increases. The first graph presented is the newt mean phenotype for all simulations as the number of generations increases. There are some lines that are squiggly and some lines that are flat. The second plot is the represents the snake mean phenotype as the number of generations increases for all the simulations. The third plot, shows both the newt and snake mean phenotype (red, blue) and the difference between the snake mean phenotype and the newt mean phenotype (snake-newt, black).
First things that I noticed, are that there are some newt and snake phenotypes that start of really high (I had to cut them so 1st gen is not present). These really high phenotypes dropped after the first generation and were seen in simulations that had a higher mu*si^2 value (last 2 rows/columns). A question that I had after seeing these plots are why are some of them (snake/newt mean phenotypes) flat? Also, the combination of mu times sigma^2 increases the amount of variation. For snakes variation going up as you go down the rows (least A->E->I->M most) and for newts variation increases as you go across the columns (least M->N->O->P most). It might not be strange to see flat phenotype lines in species who have a low variation, but I expected more competition when the GAs were the same. The simulations that seemed to have the most completion were K, L, O, and P. It might be a generation problem, it there where more generations would variation eventually increase? This is one value for the whole simulation, what is occurring at different spatial points throughout the simulation (P.S. I recorded all individuals phenotype, species, fitness, and locations)?
Next, I checked the population size of newts and snakes through out the 5,000 generations. I found that snake population size seems to be higher than newt population size. The way that the colors are stacked indicates that some GA combinations lead to higher population sizes in a species. It is hard to tell which GA leads to a higher population size, but I would hypothesize that the simulations with higher variance (mu*si^2) will increase a species population size. I also looked at the relationship between newt and snake population size and newt/snake phenotype for all of the simulations combined.
When looking at the combined simulation data you can see a relationship between population size and phenotype. As a species population size grows so does its phenotype. For example when the population size of the newts is large then the phenotype of the newts is larger that the phenotype of the newts when the newt population is smaller. However, it is difficult to discern what is going on in each individual simulation and how close the newts and snakes phenotype match.
To get a better idea of what is going on in each simulation I plot newt population size by snake population size and color the points with the difference between snake and newt mean phenotype. The results are really cool to look at!
The relationship between a species population size and the “whining” species can be a times easy to spot (C, G, O, I, J, L, and P), but at other times it can be hard to discern. When snakes are “winning” their population size is greater than the newts. When the newts are “winning” their population size is equal or greater then the snakes. There are other question that I have for this figure, like why are A, F, K, and P not beige? Or why the species with highest variation is not “winning” in the co-evolutionary arms race? I wonder if I would get these sames results if I ran the simulation for longer? - I suspect not because it seems like the colors are getting lighter (as least they look this way in the plot).
To do a reverse check I plot newt mean phenotype by snake mean phenotype and color with the population size. It is not as pretty as the other graph, but it does show that when the phenotype of a species is low it ofter has a smaller population size. I find the smears sort of funny.
I also decided to look at the mean predation of newts by taking newt death (caused by snakes) and dividing by the total newt population size (not sure if this counts the newts that just died). Predation does not look all that different to me.
I also repeade the experiment with 20,000 and then again with 100,000 generations.
## [1] "20,000 Gen Simulation A: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "20,000 Gen Simulation B: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "20,000 Gen Simulation C: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation D: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "20,000 Gen Simulation E: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "20,000 Gen Simulation F: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "20,000 Gen Simulation G: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation H: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "20,000 Gen Simulation I: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "20,000 Gen Simulation J: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "20,000 Gen Simulation K: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation L: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "20,000 Gen Simulation M: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "20,000 Gen Simulation N: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "20,000 Gen Simulation O: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation P: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "100,000 Gen Simulation A: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-08, 0.05)"
## [1] "100,000 Gen Simulation B: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "100,000 Gen Simulation C: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation D: Snake mu-rate & effect sd (1.0e-08, 0.005) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "100,000 Gen Simulation E: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "100,000 Gen Simulation F: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "100,000 Gen Simulation G: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation H: Snake mu-rate & effect sd (1.0e-09, 0.05) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "100,000 Gen Simulation I: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "100,000 Gen Simulation J: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "100,000 Gen Simulation K: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation L: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-11, 5.0)"
## [1] "100,000 Gen Simulation M: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-08, 0.005)"
## [1] "100,000 Gen Simulation N: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-09, 0.05)"
## [1] "100,000 Gen Simulation O: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation P: Snake mu-rate & effect sd (1.0e-11, 5.0) Newt mu-rate & effect sd (1.0e-11, 5.0)"
thoughts
a simulation with no interaction
check that that column is the variance mu*sig^2 = 2.5e-13 2.5e-12 vs 2.5e-13
try to check out the sigma values 0.015 1e-8(0.005)^2=2.5e-13 1e-9(0.05)^2=2.5e-12 1e-10(0.5)^2=2.5e-11 1e-11(5)^2=2.5e-10
lets set everything to 2.5e-11
Now making the smprime with these 1e-12(5)^2 = 2.5e-11 1e-10(0.5)^2 = 2.5e-11 1e-8(0.05)^2 = 2.5e-11 1e-6(0.005)^2 = 2.5e-11